package com.sj.androidbasedemo;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.widget.TextView;

public class DisplayMessageActivity extends Activity {

	@Override
	protected void onDestroy() {
		Log.i("mydebug", "i'm onDestroy");
		super.onDestroy();
	}

	@Override
	protected void onPause() {
		Log.i("mydebug", "i'm onPause");
		super.onPause();
	}

	@Override
	protected void onRestart() {
		Log.i("mydebug", "i'm onRestart");
		super.onRestart();
	}

	@Override
	protected void onResume() {
		Log.i("mydebug", "i'm onResume");
		super.onResume();
	}

	@Override
	protected void onStart() {
		Log.i("mydebug", "i'm onStart");
		super.onStart();
	}

	@Override
	protected void onStop() {
		Log.i("mydebug", "i'm onStop");
		super.onStop();
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_display_message);
		
		Intent intent = getIntent();
		String text = intent.getStringExtra(MainActivity.EXTRA_MESSAGE);
		TextView messageText = (TextView) findViewById(R.id.messageText);
		messageText.setText(text);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.display_message, menu);
		return true;
	}
	
	

}
